package template.datasource.druid;



import template.utils.Utils;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

/*
 * 完成添加操作：给account表添加一条记录
 */
public class UtilTest {
    public static void main(String[] args) {
        Connection con = null;
        PreparedStatement pps =null;
        try {
            con = Utils.getConection();
            //定义Sql对象
            String sql="delete from account where id=? ";
            pps = con.prepareStatement(sql);
            //赋值
            pps.setInt(1,5);
            int i = pps.executeUpdate();
            System.out.println(i);
        } catch (SQLException e) {
            e.printStackTrace();
        }finally {
            Utils.close(null,con,pps);
        }
    }
}
